Full Subtractor Virtual Laboratory

PrayogSetu — Interactive Digital Electronics Experiment
Digital Electronics
EXPERIMENT MODE:
🎛️ Digital Input Controls (3 Inputs)
A Minuend
B Subtrahend
Bin Borrow In
📊 Output Monitor & LED Indicators
DIFFERENCE (D)
A ⊕ B ⊕ Bin 0
BORROW OUT (Bout)
AB + ABin + BBin 0
INTERMEDIATE LOGIC PROBES:
A = 1
A ⊕ B = 0
A·B = 0
A·Bin = 0
B·Bin = 0
✓ FULL SUBTRACTOR VERIFIED
Subtraction: 0 − 0 − 0 = 0 (Difference 0, Borrow Out 0)
⚡ Full Subtractor Gate-Level Schematic & Signal Flow GATE-LEVEL VIEW
DIFFERENCE PATH (D = A ⊕ B ⊕ Bin) BORROW OUT PATH (Bout = A·B + A·Bin + B·Bin) A MINUEND 0 B SUBTRAHEND 0 Bin BORROW IN 0 NOT XOR1 AND1 AND2 AND3 XOR2 OR1 D DIFFERENCE Bout BORROW OUT A⊕B = 0 A = 1 A·B = 0 A·Bin = 0 B·Bin = 0
🧮 Binary Subtraction Calculation
Minuend (A): 0
− Subtrahend (B): 0
− Borrow In (Bin): 0
Difference (D): 0
Borrow Out (Bout): 0
📝 Step-by-Step Breakdown:
Calculation: 0 − 0 − 0 = 0
• Minuend A is 0, Subtrahend B is 0, Borrow In Bin is 0.
• 0 − 0 = 0 (No borrow generated).
• Subtracting Bin (0): 0 − 0 = 0.
• Final Result: Difference D = 0, Borrow Out Bout = 0.
📑 Complete Truth Table (All 8 Input Combinations) Click any row below to test that input state directly in the simulator
Row INPUTS OUTPUTS Verification Status
A (Minuend) B (Subtrahend) Bin (Borrow In) Difference (D) Borrow Out (Bout)
1 0 0 0 0 0 0 − 0 − 0 = 0 (Bout=0)
2 0 0 1 1 1 0 − 0 − 1 = 1 (Bout=1)
3 0 1 0 1 1 0 − 1 − 0 = 1 (Bout=1)
4 0 1 1 0 1 0 − 1 − 1 = 0 (Bout=1)
5 1 0 0 1 0 1 − 0 − 0 = 1 (Bout=0)
6 1 0 1 0 0 1 − 0 − 1 = 0 (Bout=0)
7 1 1 0 0 0 1 − 1 − 0 = 0 (Bout=0)
8 1 1 1 1 1 1 − 1 − 1 = 1 (Bout=1)
📚 Educational Guide & Circuit Theory

1. What is a Full Subtractor?

A Full Subtractor is a combinational digital logic circuit that performs binary subtraction taking into account a borrow produced by a lower significant stage. Unlike a Half Subtractor (which only accepts 2 inputs A and B), a Full Subtractor processes 3 binary inputs:

  • Minuend (A): The binary digit from which another digit is to be subtracted.
  • Subtrahend (B): The binary digit to be subtracted from the minuend.
  • Borrow In (Bin): The borrow generated by the previous stage subtraction.

2. Boolean Expressions & Logic Formulation

The two outputs of a Full Subtractor are derived using canonical sum-of-products Boolean expressions:

Difference (D):
D = A ⊕ B ⊕ Bin
Borrow Out (Bout):
Bout = AB + ABin + BBin
(Or equivalently: Bout = AB + (A ⊕ B)′ · Bin)

3. Gate-Level Implementation Details

As visualized in the gate-level schematic above, a Full Subtractor can be constructed using:

  • 2 XOR Gates: XOR1 computes A ⊕ B, and XOR2 computes (A ⊕ B) ⊕ Bin to yield Difference D.
  • 1 NOT Gate: Inverts Minuend A to produce A̅.
  • 3 AND Gates: Generate product terms A̅B, A̅Bin, and BBin.
  • 1 OR Gate: Combines the three product terms to produce Borrow Out Bout.

4. Practical Applications

Full Subtractors are fundamental building blocks in digital hardware design and computing systems:

  • 💻 Arithmetic Logic Units (ALU): Core component in CPUs for executing binary subtraction and comparison operations.
  • 🔢 Binary Arithmetic Hardware: Cascaded in multi-bit ripple-borrow or lookahead borrow subtractors.
  • 🧠 Microcontrollers & Digital Processors: Embedded hardware processing signed & unsigned binary math.
  • 🧮 Digital Calculators: Performing high-speed mathematical operations.
  • ⚙️ Digital Computing Systems: Used in DSPs, control units, and FPGA logic cells.